package com.yanqu.road.server.cmd.cookboy.process2;

import com.yanqu.road.pb.cookboy.CookBoyProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.cookboy.CrossCookBoyMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

import java.util.List;


@Cmd(code = Protocol.C_CROSS_COOK_BOY2_UNION_RELATION, desc = "小当家第2阶段获取门客亲家信息")
public class CrossGetUnionRelationCmd extends CrossCommand {

    private long userId;
    private int activityId;
    private List<Long> unionUserIdList;
    private List<Long> relationUserIdlist;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        CookBoyProto.CrossCookBoy2SearchReqMsg reqMsg = CookBoyProto.CrossCookBoy2SearchReqMsg.parseFrom(packet.getBytes());
        userId = packet.getPlayerId();
        activityId = reqMsg.getActivityId();
        unionUserIdList = reqMsg.getUnionListList();
        relationUserIdlist = reqMsg.getMarryListList();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossCookBoyMgr.getUnionRelation(activityId,serverId,userId,unionUserIdList,relationUserIdlist);
    }

    @Override
    public void sendData() {

    }

}
